{php}
    $field['config']['group'] = isset($field['config']['group'])?$field['config']['group']:0;
    $field['config']['tree'] = isset($field['config']['tree'])?$field['config']['tree']:0;
    $field['config']['rootitem'] = isset($field['config']['rootitem'])?$field['config']['rootitem']:0;
    $field['config']['editable'] = isset($field['config']['editable'])?$field['config']['editable']:0;
    $_dat = [];
    if ($cid = \think\Db::name('datadictcate')->where([
        'field'     =>  $field['config']['datadict'],
        'status'    =>  1,
    ])->value('id')) {
        $_dat = \think\Db::name('datadict')->where([
            'category_id'   =>  $cid,
            'status'        =>  1,
        ])->order('sort desc')->select();
    }
    $field['config']['tree'] = 1;
    $field['config']['valuefield'] = 'value';
    $field['config']['titlefield'] = 'title';
    $_str = \ebcms\Func::select($_dat,$field['config'],$field['value']);
{/php}
{eq name='field.config.editable' value='1'}
    <table class="table" style="margin-bottom: 0px;">
        <tr>
            <td style="padding: 0px !important;">
                <input type="text" class="form-control" id="{$field.unique}_obj" name="{$field.field}" value="{$field.value}" placeholder="{$field.config.prompt|default=''}" {eq name='field.config.readonly' value='1'} readonly{/eq} {eq name='field.config.disabled' value='1'} disabled{/eq}>
            </td>
            <td style="width: 150px;padding: 0px 0px 0px 10px !important;">
                <select class="form-control" id="{$field.unique}" onchange="$('#{$field.unique}_obj').val($(this).val());" {eq name='field.config.readonly' value='1'} readonly{/eq} {eq name='field.config.disabled' value='1'} disabled{/eq}>
                    {$_str}
                </select>
            </td>
        </tr>
    </table>
{else/}
    <select class="form-control" id="{$field.unique}" name="{$field.field}" {eq name='field.config.readonly' value='1'} readonly{/eq} {eq name='field.config.disabled' value='1'} disabled{/eq}>
        {$_str}
    </select>
{/eq}